﻿@using FCDB.WEB.PagedQuery
@model FCDB.WEB.Models.PagedList<FCDB.Entity.EntityEx.FormCDBEx>
@{
    ViewBag.Title = "业务明细";
    Layout = "~/Views/Shared/_POContentLayout.cshtml";
}
@section HeadIncluder
{
  <link rel="stylesheet" type="text/css" href=@Url.Content("~/Scripts/skins/default.css") /> 
<link href='@Url.Content("~/Content/public.css")' type="text/css" rel="stylesheet" />
<link href='@Url.Content("~/Content/con_style.css")' type="text/css" rel="stylesheet" />
 
}
@{
        
    FCDB.Entity.EntityEx.BusinessReportModel BusiModel = ViewBag.BusiModel as FCDB.Entity.EntityEx.BusinessReportModel;
<form id="GetForm" name="GetForm" method="get" action="@Url.Action("BusinessDetail", "BusinessReport")">
    <div>
        <table class="tb-search mb10" style="width: 100%;">
            <tr>
                <td class="box " style="width: 80%;"> 
                    法院:<input class="input-style-txt form-input" id="Court" name="Court" value="@BusiModel.Court" style="width: 120px" type="text" >
                    创建时间:<input   id="dtStart" name="dtStart" value="@BusiModel.dtStart.Value.ToString("yyyy-MM-dd")" style="width: 120px" type="text" />至：
                    <input   id="dtEnd"  name="dtEnd" value="@BusiModel.dtEnd.Value.ToString("yyyy-MM-dd")" style="width: 120px" type="text" />
                    业务员:
                    <input id="txtSalesmanName" class="input-style-txt form-input" type="text" name="SalesmanName" 
                           readonly="readonly" value="@BusiModel.SalesmanName" style="width:120px;" />
                    <input type="hidden" id="SalesmanID" name="SalesmanID" value="@BusiModel.SalesmanID" />
                    <input type="button" onclick="addUsers()" value="添加" class="btn btn-blue " /> 
                     

                </td>
                <td class="box aR" rowspan="2">
                   字段选择： <select id="defaultFieldID" style="width: 120px" class="form-select" name="defaultFieldID">
    @{
        IList<FCDB.Entity.ReportFieldSettings> list = ViewBag.ReportFieldList as IList<FCDB.Entity.ReportFieldSettings>;
        FCDB.Entity.ReportFieldSettings defaultReportFieldSettings = ViewBag.DefaultReportFieldSettings as FCDB.Entity.ReportFieldSettings;
        if (list.Count > 0)
        {
            foreach (var item in list)
            {
                <option value="@item.ID" @(defaultReportFieldSettings.ID == item.ID ? "selected" : "")>@item.Name</option>
            }
        }
    }
</select>

                </td>
            </tr>
            <tr>
                <td class="box " style="width: 90%;">
                    申请人:<input class="input-style-txt form-input" id="Respondent" name="Respondent"  value="@BusiModel.Respondent" style="width: 120px" type="text" />
                    部门: 
                    <input class="input-style-txt form-input" id="txtDeptName" name="txtDeptName" value="@BusiModel.txtDeptName" readonly="readonly" style="width: 120px" type="text" />
                    <input class="input-style-txt form-input" id="DeptCode" name="DeptCode" value="@BusiModel.DeptCode" type="hidden" />
                    <input type="button" onclick="SelectDeparment(DeptCode, txtDeptName)" value="选择部门" class="btn btn-blue " /> 
                    收款状态:<select class="form-select" name="ChargeStatus">
                             <option value="0" @(BusiModel.ChargeStatus == 0 ? "selected" : "")>全部</option>
                             <option value="1" @(BusiModel.ChargeStatus == 1 ? "selected" : "")>未收款</option>
                             <option value="2" @(BusiModel.ChargeStatus == 2 ? "selected" : "")>已收款</option>
                    </select>
                    流程状态:<select class="form-select" name="ProcessStatus">
                             <option value="0" @(BusiModel.ProcessStatus == 0 ? "selected" : "")>全部</option>
                             <option value="1" @(BusiModel.ProcessStatus == 1 ? "selected" : "")>流转中</option>
                             <option value="2" @(BusiModel.ProcessStatus == 2 ? "selected" : "")>已结束</option>
                    </select>
                    提成状态:<select class="form-select" name="DebutStatus">
                            <option value="0" @(BusiModel.DebutStatus == 0 ? "selected" : "")>全部</option>
                            <option value="1" @(BusiModel.DebutStatus == 1 ? "selected" : "")>未提成</option>
                            <option value="2" @(BusiModel.DebutStatus == 2 ? "selected" : "")>已提成</option>
                    </select>
                    &nbsp; <input type="submit" id="submit" value="查找" class="btn btn-blue " />

                    &nbsp; <input type="button" id="btnExport" onclick="ExportData()" value="导出" class="btn btn-blue " />
                </td>
</tr>
        </table>
    </div>
    <div style="overflow:auto;" id="tbData">
@{
    String cssTableList = "  max-width: 100%;    width: 100%;    border: 1px solid #ddd;    border-left: 0;    border-radius: 4px;    box-shadow: 0 0 10px rgba(0,0,0, .1);";
    String cssTableListTh = "  height: auto;    font-size: 12px;    padding: 8px 10px;    border-bottom: 0;    text-align: left;   color: #fff;    font-weight: 900;    background: #65AAF8;    border-left: 1px solid #ddd;    white-space:nowrap;     text-transform: uppercase;";
    String cssTableListTd = "padding: 5px 10px;   line-height: 20px;    text-align: left;    border-top: 1px solid #ddd;    border-left: 1px solid #ddd;    white-space:nowrap; ";
    String cssTableListTr = "background: #fff;";
    <table class="table-list" style="@cssTableList">
        <thead>
            @{
                IList<String> FieldList = ViewBag.FieldList as IList<String>;
                <tr style="@cssTableListTr">
                    <th style="@cssTableListTh">序号</th>
                    @if (FieldList.Count == 0 || FieldList.Contains("CaseNumber"))
                    {
                        <th style="@cssTableListTh">案号</th>
                    }
                    @if (FieldList.Count == 0 || FieldList.Contains("ArbitrationNumber"))
                    {
                        <th style="@cssTableListTh">仲裁案号</th>
                    }
                    @if (FieldList.Count == 0 || FieldList.Contains("ApplyUser"))
                    {
                        <th style="@cssTableListTh">申请人</th>
                    }
                    @if (FieldList.Count == 0 || FieldList.Contains("Respondent"))
                    {
                        <th style="@cssTableListTh">被申请人</th>
                    }
                    @if (FieldList.Count == 0 || FieldList.Contains("ApplyGuarantee"))
                    {
                        <th style="@cssTableListTh">申请人担保情况</th>
                    }   
                    @if (FieldList.Count == 0 || FieldList.Contains("Court"))
                    {
                        <th style="@cssTableListTh">所属法院</th>
                    } 
                    @if (FieldList.Count == 0 || FieldList.Contains("Amount"))
                    {
                        <th style="@cssTableListTh">标的金额</th>
                    }
                 
                    @if (FieldList.Count == 0 || FieldList.Contains("pact_no"))
                    {
                        <th style="@cssTableListTh">协议保函编号</th>
                    }
                    @if (FieldList.Count == 0 || FieldList.Contains("FormTitle"))
                    {
                        <th style="@cssTableListTh">流程名称</th>
                    }
                    @if (FieldList.Count == 0 || FieldList.Contains("Rate"))
                    {
                        <th style="@cssTableListTh">费率(%)</th>
                    }
                    @if (FieldList.Count == 0 || FieldList.Contains("ContractAmount"))
                    {
                        <th style="@cssTableListTh">合同收款</th>
                    }
                    @if (FieldList.Count == 0 || FieldList.Contains("PayableAmount"))
                    {
                        <th style="@cssTableListTh">应付佣金</th>
                    }
                    @if (FieldList.Count == 0 || FieldList.Contains("ActualRate"))
                    {
                        <th style="@cssTableListTh">实际费率(%)</th>
                    }
                    @if (FieldList.Count == 0 || FieldList.Contains("ActualCharge"))
                    {
                        <th style="@cssTableListTh">实际收费</th>
                    }
                    @if (FieldList.Count == 0 || FieldList.Contains("SalemanName"))
                    {
                        <th style="@cssTableListTh">业务员</th>
                    }
                    @if (FieldList.Count == 0 || FieldList.Contains("DepartmentName"))
                    {
                        <th style="@cssTableListTh">所属部门</th>
                    }
                    @if (FieldList.Count == 0 || FieldList.Contains("GuaranteeSituation"))
                    {
                        <th style="@cssTableListTh">联保情况</th>
                    } 
                    @if (FieldList.Count == 0 || FieldList.Contains("ApplyAddress"))
                    {
                        <th style="@cssTableListTh">申请人地址</th>
                    }
                    @if (FieldList.Count == 0 || FieldList.Contains("ApplyIDCard"))
                    {
                        <th style="@cssTableListTh">申请人身份证或法证</th>
                    }
                    @if (FieldList.Count == 0 || FieldList.Contains("CauseOfAction"))
                    {
                        <th style="@cssTableListTh">案由</th>
                    }
                    @if (FieldList.Count == 0 || FieldList.Contains("Bond"))
                    {
                        <th style="@cssTableListTh">保证金</th>
                    }
                    @if (FieldList.Count == 0 || FieldList.Contains("CompanyUser"))
                    {
                        <th style="@cssTableListTh">联保公司的担保人</th>
                    }
                    @if (FieldList.Count == 0 || FieldList.Contains("CompanyAddress"))
                    {
                        <th style="@cssTableListTh">联保公司地址</th>
                    }
                    @if (FieldList.Count == 0 || FieldList.Contains("CompanyTel"))
                    {
                        <th style="@cssTableListTh">联保公司联系电话</th>
                    }
                    @if (FieldList.Count == 0 || FieldList.Contains("InsuranceCooperation"))
                    {
                        <th style="@cssTableListTh">保险合作情况</th>
                    }
                    @if (FieldList.Count == 0 || FieldList.Contains("BusinessRemark"))
                    {
                        <th style="@cssTableListTh">业务备注</th>
                    }
                    @if (FieldList.Count == 0 || FieldList.Contains("ChargingDate"))
                    {
                        <th style="@cssTableListTh">收费日期</th>
                    }
                    @if (FieldList.Count == 0 || FieldList.Contains("Intermediary"))
                    {
                        <th style="@cssTableListTh">实付中介费</th>
                    } 
                    @if (FieldList.Count == 0 || FieldList.Contains("RebateTime"))
                    {
                        <th style="@cssTableListTh">实际返佣时</th>
                    }
                    @if (FieldList.Count == 0 || FieldList.Contains("GuaranteeTime"))
                    {
                        <th style="@cssTableListTh">保函生成时间</th>
                    } 
                
                    @if (FieldList.Count == 0 || FieldList.Contains("ReceiptInfo"))
                    {
                        <th style="@cssTableListTh">收据开具情况</th>
                    }
                   
                    @if (FieldList.Count == 0 || FieldList.Contains("FinanceRemark"))
                    {
                        <th style="@cssTableListTh">财务备注</th>
                    }
                    @if (FieldList.Count == 0 || FieldList.Contains("IsGetFile"))
                    {
                        <th style="@cssTableListTh">是否归档</th>
                    }
                    @if (FieldList.Count == 0 || FieldList.Contains("IsCharge"))
                    {
                        <th style="@cssTableListTh">是否已收费</th>
                    }
                    @if (FieldList.Count == 0 || FieldList.Contains("Judge"))
                    {
                        <th style="@cssTableListTh">主审法官</th>
                    }
                  
                    @if (FieldList.Count == 0 || FieldList.Contains("AchievementTime"))
                    {
                        <th style="@cssTableListTh">业绩归属年月</th>
                    }
                    @if (FieldList.Count == 0 || FieldList.Contains("CaseStatus"))
                    {
                        <th style="@cssTableListTh">案件状态</th>
                    }
                    @if (FieldList.Count == 0 || FieldList.Contains("DataSend"))
                    {
                        <th style="@cssTableListTh">龙岗数据报送</th>
                    }
                    @if (FieldList.Count == 0 || FieldList.Contains("CommissionSend"))
                    {
                        <th style="@cssTableListTh">提成是否发放</th>
                    }
                    @if (FieldList.Count == 0 || FieldList.Contains("Quota"))
                    {
                        <th style="@cssTableListTh">释放额度情况</th>
                    }
                    @if (FieldList.Count == 0 || FieldList.Contains("GeneralRemark"))
                    {
                        <th style="@cssTableListTh">综合部备注</th>
                    } 
                    @if (FieldList.Count == 0 || FieldList.Contains("CreateTime"))
                    {
                        <th style="@cssTableListTh">创建日期</th>
                    }

                    @if (FieldList.Count == 0 || FieldList.Contains("financiaAmount"))
                    {
                        <th style="@cssTableListTh">财务实收金额</th>
                    }
                    @if (FieldList.Count == 0 || FieldList.Contains("CommissionApr"))
                    {
                        <th style="@cssTableListTh">提成金额</th>
                    }
                    @if (FieldList.Count == 0 || FieldList.Contains("GuaranteeType"))
                    {
                        <th style="@cssTableListTh">保函类型</th>
                    }
                    @if (FieldList.Count == 0 || FieldList.Contains("AccountRemark"))
                    {
                        <th style="@cssTableListTh">会计备注</th>
                    }
                    @if (FieldList.Count == 0 || FieldList.Contains("CompanyName"))
                    {
                        <th style="@cssTableListTh">公司名称</th>
                    }
                    @if (FieldList.Count == 0 || FieldList.Contains("Bank"))
                    {
                        <th style="@cssTableListTh">开户银行</th>
                    }
                    @if (FieldList.Count == 0 || FieldList.Contains("AccountNo"))
                    {
                        <th style="@cssTableListTh">账号</th>
                    }
                    @if (FieldList.Count == 0 || FieldList.Contains("Due"))
                    {
                        <th style="@cssTableListTh">申请金额</th>
                    }
                    @if (FieldList.Count == 0 || FieldList.Contains("PayCompany"))
                    {
                        <th style="@cssTableListTh">归属公司</th>
                    }
                    @if (FieldList.Count == 0 || FieldList.Contains("Remark"))
                    {
                        <th style="@cssTableListTh">备注</th>
                    }
                    @if (FieldList.Count == 0 || FieldList.Contains("Taxation"))
                    {
                        <th style="@cssTableListTh">应扣税费</th>
                    }
                     @if (FieldList.Count == 0 || FieldList.Contains("PaidAmount"))
                    {
                        <th style="@cssTableListTh">实付中介费</th>
                    }
                    @if (FieldList.Count == 0 || FieldList.Contains("SealStatus"))
                    {
                        <th style="@cssTableListTh">是否确认盖章</th>
                    }
                     @if (FieldList.Count == 0 || FieldList.Contains("LBgongsi"))
                    {
                        <th style="@cssTableListTh">合作公司</th>
                    }
                     @if (FieldList.Count == 0 || FieldList.Contains("DBjine"))
                    {
                        <th style="@cssTableListTh">富昌担保标的</th>
                    }
                         @if (FieldList.Count == 0 || FieldList.Contains("XYfeiyong"))
                    {
                        <th style="@cssTableListTh">富昌协议费用</th>
                    }
                      @if (FieldList.Count == 0 || FieldList.Contains("TSDBjine"))
                    {
                        <th style="@cssTableListTh">他司担保标的</th>
                    }
                     @if (FieldList.Count == 0 || FieldList.Contains("TSXYfeiyong"))
                    {
                        <th style="@cssTableListTh">他司协议费用</th>
                    }
                    @if (FieldList.Count == 0 || FieldList.Contains("FYfeiyong"))
                    {
                        <th style="@cssTableListTh">返佣费用</th>
                    }   
                    @if (FieldList.Count == 0 || FieldList.Contains("JLbaozhengjin"))
                    {
                        <th style="@cssTableListTh">是否需要保证金</th>
                    }
                    @if (FieldList.Count == 0 || FieldList.Contains("BZJjine"))
                    {
                        <th style="@cssTableListTh">富昌占总标的比例</th>
                    }
                    @if (FieldList.Count == 0 || FieldList.Contains("ZBjine"))
                    {
                        <th style="@cssTableListTh">总标的金额</th>
                    }
                       @if (FieldList.Count == 0 || FieldList.Contains("ZBbili"))
                    {
                        <th style="@cssTableListTh">占总标的比例</th>
                    }
                   
                           @if (FieldList.Count == 0 || FieldList.Contains("FCSSfeiyong"))
                    {
                        <th style="@cssTableListTh">富昌实收费用</th>
                    }
                           @if (FieldList.Count == 0 || FieldList.Contains("FCZbili"))
                    {
                        <th style="@cssTableListTh">他司占总标的比例</th>
                    }
                           @if (FieldList.Count == 0 || FieldList.Contains("TSSHfeiyong"))
                    {
                        <th style="@cssTableListTh">他司实收费用</th>
                    }
                      @if (FieldList.Count == 0 || FieldList.Contains("shouju"))
                    {
                        <th style="@cssTableListTh">收据/发票</th>
                    }
                    @if (FieldList.Count == 0 || FieldList.Contains("suifei"))
                    {
                        <th style="@cssTableListTh">税费</th>
                    }
                        
                </tr>
            }
        </thead>

        <tbody>
            @if (Model != null)
            {
                foreach (var item in Model)
                {

                    <tr style="@cssTableListTr">

                        <td style="@cssTableListTd">@item.ID</td>
                        @if (FieldList.Count == 0 || FieldList.Contains("CaseNumber"))
                        {
                            <td style="@cssTableListTd">@item.CaseNumber</td>
                        }
                        @if (FieldList.Count == 0 || FieldList.Contains("ArbitrationNumber"))
                        {
                            <td style="@cssTableListTd">@item.ArbitrationNumber</td>
                        }
                        @if (FieldList.Count == 0 || FieldList.Contains("ApplyUser"))
                        {
                            <td style="@cssTableListTd">@item.ApplyUser</td>
                        }
                        @if (FieldList.Count == 0 || FieldList.Contains("Respondent"))
                        {
                            <td style="@cssTableListTd">@item.Respondent</td>
                        }
                        @if (FieldList.Count == 0 || FieldList.Contains("ApplyGuarantee"))
                        {
                            <td style="@cssTableListTd">@item.ApplyGuarantee</td>
                        }
                        @if (FieldList.Count == 0 || FieldList.Contains("Court"))
                        {
                            <td style="@cssTableListTd">@item.Court</td>
                        } 
                        @if (FieldList.Count == 0 || FieldList.Contains("Amount"))
                        {
                            <td style="@cssTableListTd">@(item.Amount.HasValue?item.Amount.Value.ToString("#0.000"):"")</td>
                        }
                        @if (FieldList.Count == 0 || FieldList.Contains("pact_no"))
                        {
                            <td style="@cssTableListTd">@item.pact_no</td>
                        }
                        @if (FieldList.Count == 0 || FieldList.Contains("FormTitle"))
                        {
                            <td style="@cssTableListTd">@item.FormTitle</td>
                        }
                        @if (FieldList.Count == 0 || FieldList.Contains("Rate"))
                        {
                            <td style="@cssTableListTd">@(item.Rate.HasValue ? item.Rate.Value.ToString("#0.000") : "")</td>
                        }
                        @if (FieldList.Count == 0 || FieldList.Contains("ContractAmount"))
                        {
                            <td style="@cssTableListTd">@(item.ContractAmount.HasValue ? item.ContractAmount.Value.ToString("#0.000") : "")</td>
                        }
                        @if (FieldList.Count == 0 || FieldList.Contains("PayableAmount"))
                        {
                            <td style="@cssTableListTd">@(item.PayableAmount.HasValue ? item.PayableAmount.Value.ToString("#0.000") : "")</td>
                        } 
                        @if (FieldList.Count == 0 || FieldList.Contains("ActualRate"))
                        {
                            <td style="@cssTableListTd">@(item.ActualRate.HasValue ? item.ActualRate.Value.ToString("#0.000") : "")</td>
                        }
                        @if (FieldList.Count == 0 || FieldList.Contains("ActualCharge"))
                        {
                            <td style="@cssTableListTd">@(item.ActualCharge.HasValue ? item.ActualCharge.Value.ToString("#0.000") : "")</td>
                        }
                        @if (FieldList.Count == 0 || FieldList.Contains("SalemanName"))
                        {
                            <td style="@cssTableListTd">@item.SalemanName</td>
                        }
                        @if (FieldList.Count == 0 || FieldList.Contains("DepartmentName"))
                        {
                            <td style="@cssTableListTd">@item.DepartmentName</td>
                        }
                        @if (FieldList.Count == 0 || FieldList.Contains("CompanyGuarantee"))
                        {
                            <td style="@cssTableListTd">@item.CompanyGuarantee</td>
                        }
                        @if (FieldList.Count == 0 || FieldList.Contains("ApplyAddress"))
                        {
                            <td style="@cssTableListTd">@item.ApplyAddress</td>
                        }

                        @if (FieldList.Count == 0 || FieldList.Contains("ApplyAddress"))
                        {
                            <td style="@cssTableListTd">@item.ApplyAddress</td>
                        } 
                        @if (FieldList.Count == 0 || FieldList.Contains("ApplyIDCard"))
                        {
                            <td style="@cssTableListTd">@item.ApplyIDCard</td>
                        }
                        @if (FieldList.Count == 0 || FieldList.Contains("CauseOfAction"))
                        {
                            <td style="@cssTableListTd">@item.CauseOfAction</td>
                        }
                        @if (FieldList.Count == 0 || FieldList.Contains("Bond"))
                        {
                            <td style="@cssTableListTd">@(item.Bond.HasValue ? item.Bond.Value.ToString("#0.000") : "")</td>
                        }
                        @if (FieldList.Count == 0 || FieldList.Contains("CompanyGuarantee"))
                        {
                            <td style="@cssTableListTd">@item.CompanyGuarantee</td>
                        }
                        @if (FieldList.Count == 0 || FieldList.Contains("CompanyUser"))
                        {
                            <td style="@cssTableListTd">@item.CompanyUser</td>
                        }

                        @if (FieldList.Count == 0 || FieldList.Contains("CompanyAddress"))
                        {
                            <td style="@cssTableListTd">@item.CompanyAddress</td>
                        }
                        @if (FieldList.Count == 0 || FieldList.Contains("CompanyTel"))
                        {
                            <td style="@cssTableListTd">@item.CompanyTel</td>
                        }
                        @if (FieldList.Count == 0 || FieldList.Contains("InsuranceCooperation"))
                        {
                            <td style="@cssTableListTd">@item.InsuranceCooperation</td>
                        }
                        @if (FieldList.Count == 0 || FieldList.Contains("BusinessRemark"))
                        {
                            <td style="@cssTableListTd">@item.BusinessRemark</td>
                        }
                        @if (FieldList.Count == 0 || FieldList.Contains("ChargingDate"))
                        {
                            <td style="@cssTableListTd">@(item.ChargingDate.HasValue ? item.ChargingDate.Value.ToString("#yyyy-MM-dd") : "")</td>
                        }
                        @if (FieldList.Count == 0 || FieldList.Contains("Intermediary"))
                        {
                            <td style="@cssTableListTd">@(item.Intermediary.HasValue ? item.Intermediary.Value.ToString("#0.000") : "") </td>
                        }
                        @if (FieldList.Count == 0 || FieldList.Contains("RebateTime"))
                        {
                            <td style="@cssTableListTd">@(item.RebateTime.HasValue ? item.RebateTime.Value.ToString("#yyyy-MM-dd") : "")</td>
                        }

                        @if (FieldList.Count == 0 || FieldList.Contains("GuaranteeTime"))
                        {
                            <td style="@cssTableListTd">@(item.GuaranteeTime.HasValue ? item.GuaranteeTime.Value.ToString("#yyyy-MM-dd") : "")</td>
                        }
                        @if (FieldList.Count == 0 || FieldList.Contains("ReceiptInfo"))
                        {
                            <td style="@cssTableListTd">@item.ReceiptInfo</td>
                        }
                        @if (FieldList.Count == 0 || FieldList.Contains("FinanceRemark"))
                        {
                            <td style="@cssTableListTd">@item.FinanceRemark</td>
                        }
                        @if (FieldList.Count == 0 || FieldList.Contains("IsGetFile"))
                        {
                            <td style="@cssTableListTd">@(item.IsGetFile==true?"是":"否")</td>
                        }
                        @if (FieldList.Count == 0 || FieldList.Contains("IsCharge"))
                        {
                            <td style="@cssTableListTd">@(item.IsCharge==true?"是":"否")</td>
                        }
                        @if (FieldList.Count == 0 || FieldList.Contains("Judge"))
                        {
                            <td style="@cssTableListTd">@item.Judge</td>
                        }
                        @if (FieldList.Count == 0 || FieldList.Contains("AchievementTime"))
                        {
                            <td style="@cssTableListTd">@(item.AchievementTime.HasValue ? item.AchievementTime.Value.ToString("#yyyy-MM-dd") : "")</td>
                        }
                        @if (FieldList.Count == 0 || FieldList.Contains("CaseStatus"))
                        {
                            <td style="@cssTableListTd">@item.CaseStatus</td>
                        }
                        @if (FieldList.Count == 0 || FieldList.Contains("DataSend"))
                        {
                            <td style="@cssTableListTd">@item.DataSend</td>
                        }
                        @if (FieldList.Count == 0 || FieldList.Contains("CommissionSend"))
                        {
                            <td style="@cssTableListTd">@(item.CommissionSend == true ? "是" : "否")</td>
                        }
                        @if (FieldList.Count == 0 || FieldList.Contains("Quota"))
                        {
                            <td style="@cssTableListTd">@item.Quota</td>
                        }
                        @if (FieldList.Count == 0 || FieldList.Contains("GeneralRemark"))
                        {
                            <td style="@cssTableListTd">@item.GeneralRemark</td>
                        }
                         
                        @if (FieldList.Count == 0 || FieldList.Contains("CommissionApr"))
                        {
                            <td style="@cssTableListTd">@(item.CommissionApr.HasValue ? item.CommissionApr.Value.ToString("#0.000") : "")</td>
                        }
                        
                        @if (FieldList.Count == 0 || FieldList.Contains("GuaranteeType"))
                        {
                            <td style="@cssTableListTd">@item.GuaranteeType</td>
                        }
                       @if (FieldList.Count == 0 || FieldList.Contains("AccountRemark"))
                       {
                        <td style="@cssTableListTd">@item.AccountRemark</td>
                       }
                        @if (FieldList.Count == 0 || FieldList.Contains("CompanyName"))
                        {
                            <td style="@cssTableListTd">@item.CompanyName</td>
                        }
                        @if (FieldList.Count == 0 || FieldList.Contains("Bank"))
                        {
                            <td style="@cssTableListTd">@item.Bank</td>
                        }
                        @if (FieldList.Count == 0 || FieldList.Contains("Due"))
                        {
                            <td style="@cssTableListTd">@(item.Due.HasValue ? item.Due.Value.ToString("#0.000") : "")</td>
                        }
                        @if (FieldList.Count == 0 || FieldList.Contains("PayCompany"))
                        {
                            <td style="@cssTableListTd">@item.PayCompany</td>
                        }
                        @if (FieldList.Count == 0 || FieldList.Contains("Remark"))
                        {
                            <td style="@cssTableListTd">@item.Remark</td>
                        }
                        @if (FieldList.Count == 0 || FieldList.Contains("Taxation"))
                        {
                            <td style="@cssTableListTd">@(item.Taxation.HasValue ? item.Taxation.Value.ToString("#0.000") : "")</td>
                        }
                        @if (FieldList.Count == 0 || FieldList.Contains("PaidAmount"))
                        {
                            <td style="@cssTableListTd">@(item.PaidAmount.HasValue ? item.PaidAmount.Value.ToString("#0.000") : "")</td>
                        }
                        @if (FieldList.Count == 0 || FieldList.Contains("SealStatus"))
                        {
                            <td style="@cssTableListTd">@item.SealStatus</td>
                        }
                        @if (FieldList.Count == 0 || FieldList.Contains("LBgongsi"))
                        {
                            <td style="@cssTableListTd">@item.LBgongsi</td>
                        }
                        @if (FieldList.Count == 0 || FieldList.Contains("DBjine"))
                        {
                            <td style="@cssTableListTd">@(item.DBjine.HasValue ? item.DBjine.Value.ToString("#0.000") : "")</td>
                        }
                        @if (FieldList.Count == 0 || FieldList.Contains("XYfeiyong"))
                        {
                            <td style="@cssTableListTd">@(item.XYfeiyong.HasValue ? item.XYfeiyong.Value.ToString("#0.000") : "")</td>
                        }
                        @if (FieldList.Count == 0 || FieldList.Contains("TSDBjine"))
                        {
                            <td style="@cssTableListTd">@(item.TSDBjine.HasValue ? item.TSDBjine.Value.ToString("#0.000") : "")</td>
                        }
                        @if (FieldList.Count == 0 || FieldList.Contains("TSXYfeiyong"))
                        {
                            <td style="@cssTableListTd">@(item.TSXYfeiyong.HasValue ? item.TSXYfeiyong.Value.ToString("#0.000") : "")</td>
                        }
                        @if (FieldList.Count == 0 || FieldList.Contains("FYfeiyong"))
                        {
                            <td style="@cssTableListTd">@(item.FYfeiyong.HasValue ? item.FYfeiyong.Value.ToString("#0.000") : "")</td>
                        }
                        @if (FieldList.Count == 0 || FieldList.Contains("JLbaozhengjin"))
                        {
                            <td style="@cssTableListTd">@item.JLbaozhengjin</td>
                        }
                        @if (FieldList.Count == 0 || FieldList.Contains("BZJjine"))
                        {
                            <td style="@cssTableListTd">@(item.BZJjine.HasValue ? item.BZJjine.Value.ToString("#0.000") : "")</td>
                        }
                        @if (FieldList.Count == 0 || FieldList.Contains("ZBjine"))
                        {
                            <td style="@cssTableListTd">@(item.ZBjine.HasValue ? item.ZBjine.Value.ToString("#0.000") : "")</td>
                        }
                        @if (FieldList.Count == 0 || FieldList.Contains("ZBbili"))
                        {
                            <td style="@cssTableListTd">@(item.ZBbili.HasValue ? item.ZBbili.Value.ToString("#0.000") : "")</td>
                        }
                        
                        @if (FieldList.Count == 0 || FieldList.Contains("FCSSfeiyong"))
                        {
                            <td style="@cssTableListTd">@(item.FCSSfeiyong.HasValue ? item.FCSSfeiyong.Value.ToString("#0.000") : "")</td>
                        }
                        @if (FieldList.Count == 0 || FieldList.Contains("FCZbili"))
                        {
                            <td style="@cssTableListTd">@(item.FCZbili.HasValue ? item.FCZbili.Value.ToString("#0.000") : "")</td>
                        }
                        @if (FieldList.Count == 0 || FieldList.Contains("TSSHfeiyong"))
                        {
                            <td style="@cssTableListTd">@(item.TSSHfeiyong.HasValue ? item.TSSHfeiyong.Value.ToString("#0.000") : "")</td>
                        }
                        @if (FieldList.Count == 0 || FieldList.Contains("shouju"))
                        {
                            <td style="@cssTableListTd">@item.shouju</td>
                        }
                        @if (FieldList.Count == 0 || FieldList.Contains("suifei"))
                        {
                            <td style="@cssTableListTd">@(item.suifei.HasValue ? item.suifei.Value.ToString("#0.000") : "")</td>
                        } 
                    </tr>
                }
            }
        </tbody>

    </table>
}

    </div>
    <div class="bot_bar fn-clear J_fixeBot">
        @Html.Pager(Model, new FCDB.WEB.PagedQuery.PagerOptions
       {
           PageIndexParameterName = "pageIndex",
           AutoHide = false,
           CurrentPagerItemWrapperFormatString = "<span class=\"page_now\">{0}</span>",
           ShowGoButton = true,
           GoButtonText = "goto",
           NumericPagerItemCount = Model.PageSize,
           ShowPageIndexBox = true,
           GoToPageSectionWrapperFormatString = "{0}",
           ShowMorePagerItems = true,
           NumericPagerItemWrapperFormatString = "<span class=\"item\">{0}</span>",
           CssClass = "pagebar",
           SeparatorHtml = "",
           ShowPageSize = true,
           PageSizeParameterName = "pageSize",
           PageSizeBoxType = FCDB.WEB.PagedQuery.PageSizeBoxType.TextBox
       })
    </div>
</form>
<script type="text/javascript" src='@Url.Content("~/Scripts/lhgdialog.min.js")'> </script> 
    

<script type="text/javascript">
    function ExportData() {
        var FileStr = encodeURI($("#tbData").html());
        var FileName = "业绩明细";
        var url = '@Url.Action("SaveFile", "BusinessReport")';
        $.post(url, { strContent: FileStr, FileName: FileName }, function () {
            location = url;
        });
    }
    $(function () {
        $("#dtStart").kendoDatePicker({ format: "yyyy-MM-dd" });
        $("#dtEnd").kendoDatePicker({ format: "yyyy-MM-dd" });
    });
    function addUsers() {
        var url = '@Url.Action("EmployeeSelect", "Employee")';
        OpenSelectUserPop(url, RefreshValue);
    }
    function RefreshValue(selectPostList) {
        if (selectPostList != null || selectPostList != undefined) {
            var strNames = "";
            var strUserIDs = "";
            $.each(selectPostList, function (i, val) {
                strNames = val.Name;
                strUserIDs = val.UserID;
                $("#txtSalesmanName").val(strNames);
                $("#SalesmanID").val(strUserIDs);
            });
        }
    }
    function SelectDeparment(valtag, textTag) {
        var url = '@Url.Action("UCDepartmentSelect", "Form")';
        window.top.winObj = window;
        window.top.refresh = function (vals, txts) {
            $(valtag).val(vals);
            $(textTag).val(txts);
        };
        window.top.oDG = $.dialog({
            lock: true,
            background: '#FFF',
            opacity: 0.5,
            id: 'esDialog',
            title: '部门选择',
            titleAlign: 'left',
            content: "url:" + url,
            width: 570,
            height: 300,
            btnBar: false,
            lockScroll: true
        });
    } 
    
</script>
}